package com.kang.controller.feign;

import com.kang.feign.AdminFeign;
import com.kang.util.WebResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "标签调用")
@RequestMapping("/user/labelFeign")
@Slf4j
public class LabelFeignController {

    @Autowired
    private AdminFeign labelFeign;

    @ApiOperation("获取所有标签")
    @GetMapping("getLabelByType")
    public WebResponse getLabelByType(Integer type) {
        try {
            return WebResponse.resSuccess("获取所有标签成功",labelFeign.getLabelByType(type));
        } catch (Exception ex) {
            log.info("获取所有标签失败",ex);
            return WebResponse.resFail("获取所有标签失败",null);
        }
    }

}
